package com.s08.h01;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.s08.h01.model.Book;
import com.s08.h01.model.GoldUser;
import com.s08.h01.model.Ipod;
import com.s08.h01.model.StandardUser;
import com.s08.h01.model.TV;
import com.s08.h01.model.User;
import com.s08.h01.utils.UserUtils;

public class MyInheritance {

	public static void main(String[] args) { 
		
		List users= new ArrayList();
		
		users.add(new StandardUser ("Grzegorz", "Solecki"));
		users.add(new StandardUser ("Roman", "Kosecki"));
		users.add(new GoldUser("Adam", "Niezgodka"));
		

		StandardUser standardUser1 = (StandardUser) users.get(0);
		StandardUser standardUser2 = (StandardUser) users.get(1);
		standardUser1.getCart().add(new TV(new BigDecimal("50.00").setScale(2, RoundingMode.HALF_DOWN)));
		standardUser1.getCart().add(new Book(new BigDecimal("10.00").setScale(2, RoundingMode.HALF_DOWN)));
		standardUser1.getCart().add(new Ipod(new BigDecimal("150.00").setScale(2, RoundingMode.HALF_DOWN)));

		standardUser2.getCart().add(new TV(new BigDecimal("50.00").setScale(2, RoundingMode.HALF_DOWN)));
		standardUser2.getCart().add(new Ipod(new BigDecimal("150.00").setScale(2, RoundingMode.HALF_DOWN)));
		standardUser2.getCart().add(new Book(new BigDecimal("10.00").setScale(2, RoundingMode.HALF_DOWN)));
		
		
		GoldUser goldUser = (GoldUser) users.get(2);
		goldUser.getCart().add(new TV(new BigDecimal("50.00").setScale(2, RoundingMode.HALF_DOWN)));
		goldUser.getCart().add(new Book(new BigDecimal("10.00").setScale(2, RoundingMode.HALF_DOWN)));
		goldUser.getCart().add(new Ipod(new BigDecimal("150.00").setScale(2, RoundingMode.HALF_DOWN)));
		
		
		
		
		//UserUtils.listUsers(users);
		UserUtils.listUsersProducts(users);
		
	}
}
